<template>
	<view class="html_txt">
		<view class="text" v-html="htmlTxt"></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				htmlTxt:'',
			};
		},
		onLoad(opt) {
			if(opt.type==1){
				uni.setNavigationBarTitle({
					title: '用户协议'
				})
				this.infoData('yonghuxieyi')
			}else if(opt.type==2){
				uni.setNavigationBarTitle({
					title: '隐私政策'
				})
				this.infoData('user_ysxy')
			}else if(opt.type==3){
				uni.setNavigationBarTitle({
					title: '关于我们'
				})
				this.infoData('guanyuwomen')
			}else if(opt.type==4){
				uni.setNavigationBarTitle({
					title: '帮助与反馈'
				})
				this.infoData('bangzhufankui')
			}else if(opt.type==6){
				uni.setNavigationBarTitle({
					title: '申请合伙人'
				})
				this.infoData(opt.type)
			}else if(opt.type==5){
				uni.setNavigationBarTitle({
					title: '赚佣必读'
				})
				this.infoData(opt.type)
			}else if(opt.type==7){
				uni.setNavigationBarTitle({
					title: '一证通查'
				})
				this.infoData(opt.type)
			}else if(opt.type==8){
				uni.setNavigationBarTitle({
					title: '通知内容'
				})
				this.infoData(opt.type,opt.ids)
			}
		},
		methods:{
			infoData(code=''){
				var that = this
				that.$tips.showLoading('加载中')
				that.$httpApi.indexConfig({code:code}).then((res)=>{
					that.$tips.hideLoading()
					if(res.code==1){
						that.htmlTxt=res.data.content
					}
				})
			},
			// 联系客服
			// serviceInfo(){
			// 	var that = this
			// 	that.$tips.showLoading('加载中')
			// 	that.$httpApi.kfInfo().then((res)=>{
			// 		that.$tips.hideLoading()
			// 		if(res.code==1){
			// 			that.htmlTxt=res.data
			// 		}
			// 	})
			// },
		},
	}
</script>

<style lang="less">
.html_txt{
	padding: 24rpx;
	width: 100%;
	.text{
		width: 100%;
		::v-deep p{
			width: 100%;
			image{
				display: block;
				width: 100% !important;
			}
			img{
				display: block;
				width: 100% !important;
			}
		}
	}
}
</style>
